#include<fcntl.h>
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
#define SIZE 10000 
int fd;

void  panic(char *message)
{
	perror(message);
	exit(EXIT_FAILURE);
}

int main(int argc, char *argv[])
{
	if(argc<1)
		panic("need file");
	char buf[SIZE];
	char* path=argv[1];
	fd=open(path, O_RDONLY);
	if(fd<0)
		panic("open");
	int Read=read(fd, buf, sizeof(buf));
	if(Read<0)
		panic("read");
	close(fd);
	puts(buf);
	return 0;
}
